package com.atguigu.func;

import com.atguigu.beans.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @author: china
 * @create: 2024-04-02 20:08
 * @description:
 **/
public class WaterSensorMapFunction implements MapFunction<String, WaterSensor> {
    @Override
    public WaterSensor map(String s) throws Exception {
        String[] fieldArr = s.split(",");
        return new WaterSensor(fieldArr[0], Long.valueOf(fieldArr[1]), Integer.valueOf(fieldArr[2]));
    }
}
